package com.chen.controller;

import com.chen.annotation.MyAnnotation;
import com.chen.entity.User;
import com.chen.service.UserService;
import com.chen.entity.vo.Result;
import com.chen.entity.vo.ResultCodeEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @MyAnnotation(title = "user")
    @GetMapping("")
    public Result<List<User>> selectAll(){
        List<User> userList= userService.selectAll();
        return Result.build(userList, ResultCodeEnum.SUCCESS);
    }
}
